#ifndef GLOBAL_MACROS_H
#define GLOBAL_MACROS_H

#define NAMESPACE_BEGIN namespace ens {
#define NAMESPACE_END }

#define nmspc ens

#include <iostream>
#define ENS_LOG___ERROR(x) (std::cerr << "\033[31m" << (x) << "\033[0m" << std::endl)
#define ENS_LOG_SUCCESS(x) (std::cerr << "\033[32m" << (x) << "\033[0m" << std::endl)
#define ENS_LOG____INFO(x) (std::cerr << "\033[36m" << (x) << "\033[0m" << std::endl)
#define ENS_LOG___TRACE(x) (std::cerr << (x) << std::endl)

#include <fstream>
#define ENS_FILE_LOG(x) {\
	std::unique_lock<std::mutex> lock(nmspc::log_file_mtx);\
	std::ofstream fout(nmspc::log_file, std::ios::app);\
	if (fout.is_open()) {\
		fout << (x) << std::endl;\
		fout.close();\
	}\
}

#define BIT(x) (1 << x)

#endif // !GLOBAL_MACROS_H
